package com.hf.lookatme.zpresenter;

import android.content.Context;

import com.hf.lookatme.zbean.RegionData;
import com.hf.lookatme.zmodel.IModel_RegionData;
import com.hf.lookatme.zmodel.impls.Model_RegionData;
import com.hf.lookatme.zmodel.loadlistener.OnLoadRegionDataListener;
import com.hf.lookatme.zview.interfaces.IView_Activity_PartTimeJob_SelectWorkLocation;

import java.util.List;

/**
 * Created by JoeShiguang on 2015/6/10.
 */
public class Present_Activity_PartTimeJob_SelectWorkLocation implements OnLoadRegionDataListener {

  private IModel_RegionData model_regionData;

  private IView_Activity_PartTimeJob_SelectWorkLocation view;

  public Present_Activity_PartTimeJob_SelectWorkLocation(IView_Activity_PartTimeJob_SelectWorkLocation iView) {

    this.view = iView;
    this.model_regionData = new Model_RegionData();
  }


  public void getProvinceData(Context context) {

    model_regionData.getProvinceData(context, this);
  }

  public void getCityData(Context context, int provinceID) {

    model_regionData.getCityData(context, this, provinceID);
  }

  public void getAreaData(Context context, int cityID) {

    model_regionData.getAreaData(context, this, cityID);
  }


  @Override
  public void onLoadProvinceDataSuccess(List<RegionData> list_province) {

    view.buildProvinceWheelView(list_province);
  }

  @Override
  public void onLoadProvinceDataFailed(String failedInfo) {

  }

  @Override
  public void onLoadCityDataSuccess(List<RegionData> list_city) {

    view.buildAreaWheelView(list_city);
  }

  @Override
  public void onLoadCityDataFailed(String failedInfo) {

  }

  @Override
  public void onLoadAreaDataSuccess(List<RegionData> list_area) {

    view.buildAreaWheelView(list_area);
  }

  @Override
  public void onLoadAreaDataFailed(String failedInfo) {

  }
}
